<?php
include_once("../service/productService.php");
include_once("../util/constant.php");

$name = $_POST["name"];
$value = $_POST["value"];
$disId = $_POST["disId"];

if(updateDiscount($disId, $name, $value / 100))
	echo "<script>window.location.href = '../admin/discount-detail.php?action=".UPDATE_SUCCESSFULLY."&id=".$disId."';</script>";
else
	echo "<script>window.location.href = '../admin/discount-detail.php?action=".UPDATE_FAILED."&id=".$disId."';</script>";
?>